Creating Measures 9
To Create Measures:
- - Right click on Modelling
- - Select New measure or right click on the table and click new measure
- - Copy and paste the Dax below one at a time and then click the check mark, or enter
- - Repeat the steps to create the rest of the measures
M Measures:
# .# of Approved =
SUM('H-1B VISAS'[APPROVED])
.Total Cases = COUNT('H-1B VISAS'[CASE_NUMBER])
Approved Cases = [.# of Approved] /
[.Total Cases]
.YOY LY = CALCULATE([.Total
Cases],DATEADD('Date'[Date],-1,YEAR) )
.YOY% = .YoY% = VAR __PREV_YEAR = CALCULATE( AVERAGE('H-1B
VISAS'[APPROVED]), DATEADD('Date'[Date], -1, YEAR) )
RETURN DIVIDE( AVERAGE('H-1B VISAS'[APPROVED])
- __PREV_YEAR, __PREV_YEAR)
.YOY = SWITCH ( TRUE (),
[.YoY%] < 0, UNICHAR ( 9660 ),UNICHAR ( 9650 ))
& ROUND ( [.YoY%], 4 ) * 100 & " %"
Follow the Gif below
Below is a video about Dax Measures in Power BI: